package com.yanq.liancar.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yanq.liancar.R;
import com.yanq.liancar.bean.ShopCommentBean;
import com.yanq.liancar.bean.ShopEvaluateBean;

import java.util.List;

public class ShopCommentAdapter extends BaseQuickAdapter<ShopCommentBean.DataBean,BaseViewHolder> {
    public ShopCommentAdapter(int layoutResId, @Nullable List<ShopCommentBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ShopCommentBean.DataBean item) {
                helper.setText(R.id.tv_name,item.getUser().getUsername())
                .setText(R.id.tv_content,item.getContent())
                .setText(R.id.tv_time,item.getRemarkDate());

        ImageView imageView=helper.getView(R.id.img_head);
        RequestOptions options=new RequestOptions();
        options.placeholder(R.mipmap.vip_touxiang);
        Glide.with(mContext).load(item.getUser().getHeadPage()).apply(options).into(imageView);
    }
}
